package cn.edu.njuit.lesson9heros.service.impl;

import cn.edu.njuit.lesson9heros.myioc.MyComponent;
import cn.edu.njuit.lesson9heros.pojo.Team;
import cn.edu.njuit.lesson9heros.service.GameService;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@MyComponent(name="gameService")
@Service
public class GameServiceImpl implements GameService {
    /**
     * 输入红蓝队伍，开始游戏
     * @param blueTeam 蓝队
     * @param redTeam 红队
     */
    @Override
    public void play(Team blueTeam, Team redTeam) {
        System.out.printf("**********游戏开始*********");
        System.out.printf("\n【对局信息】：");
        System.out.printf("\n蓝队:\t上路-%s\t中路-%s\t下路-%s\t辅助-%s\t打野-%s\n"
                ,blueTeam.getTopHero().getHeroName()
                ,blueTeam.getMidHero().getHeroName()
                ,blueTeam.getAdcHero().getHeroName()
                ,blueTeam.getSupportHero().getHeroName()
                ,blueTeam.getJungleHero().getHeroName());
        System.out.printf("红队:\t上路-%s\t中路-%s\t下路-%s\t辅助-%s\t打野-%s\n"
                ,redTeam.getTopHero().getHeroName()
                ,redTeam.getMidHero().getHeroName()
                ,redTeam.getAdcHero().getHeroName()
                ,redTeam.getSupportHero().getHeroName()
                ,redTeam.getJungleHero().getHeroName());
        System.out.printf("*************************\n");

        System.out.printf("蓝队:\n上路-%s,出装方案：%s\n中路-%s,出装方案：%s\n下路-%s,出装方案：%s\n辅助-%s,出装方案：%s\n打野-%s,出装方案：%s\n"
                ,blueTeam.getTopHero().getHeroName()
                ,blueTeam.getTopHero().getEquipment().toString()
                ,blueTeam.getMidHero().getHeroName()
                ,blueTeam.getMidHero().getEquipment().toString()
                ,blueTeam.getAdcHero().getHeroName()
                ,blueTeam.getAdcHero().getEquipment().toString()
                ,blueTeam.getSupportHero().getHeroName()
                ,blueTeam.getSupportHero().getEquipment().toString()
                ,blueTeam.getJungleHero().getHeroName()
                ,blueTeam.getJungleHero().getEquipment().toString()
        );

        System.out.printf("红队:\n上路-%s,出装方案：%s\n中路-%s,出装方案：%s\n下路-%s,出装方案：%s\n辅助-%s,出装方案：%s\n打野-%s,出装方案：%s\n"
                ,redTeam.getTopHero().getHeroName()
                ,redTeam.getTopHero().getEquipment().toString()
                ,redTeam.getMidHero().getHeroName()
                ,redTeam.getMidHero().getEquipment().toString()
                ,redTeam.getAdcHero().getHeroName()
                ,redTeam.getAdcHero().getEquipment().toString()
                ,redTeam.getSupportHero().getHeroName()
                ,redTeam.getSupportHero().getEquipment().toString()
                ,redTeam.getJungleHero().getHeroName()
                ,redTeam.getJungleHero().getEquipment().toString()
        );
    }
}
